gdk: Add gdk_device_get_timestamp
authorMatthias Clasen <mclasen@redhat.com>
Fri, 26 Mar 2021 02:39:15 +0000 (22:39 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 26 Mar 2021 15:09:05 +0000 (11:09 -0400)
Give each device a timestamp that reflects the last
user activity with that device, as reflected in the
events that are produced for this device.

gdk/gdkevents.c

index f7abfe75b55ac050178228d91a02c5243a407eab..43e9c9f01a8d9c50515cdb936a75eed641691ded 100644 (file)
@@ -414,6 +414,9 @@ gdk_event_alloc (GdkEventType event_type,
   event->device = device != NULL ? g_object_ref (device) : NULL;
   event->time = time_;
 
+  if (device != NULL && time_ != GDK_CURRENT_TIME)
+    gdk_device_set_timestamp (device, time_);
+
   return event;
 }